<template>
    <div>

        <!--轮播图区域-->
        <mt-swipe :auto="4000">
            <mt-swipe-item v-for="(item,index) in LunbotuList" :key="index">
                <img :src="item.src" alt="">
            </mt-swipe-item>
        </mt-swipe>

        <!--九宫格区域-->
        <ul class="mui-table-view mui-grid-view mui-grid-9">
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="/home/newsList">
                    <!--<span class="mui-icon mui-icon-home"></span>-->
                    <img src="../../images/menu1.png" alt="">
                    <div class="mui-media-body">新闻资讯</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="#">
                    <!--<span class="mui-icon mui-icon-email"><span class="mui-badge">5</span></span>-->
                    <img src="../../images/menu2.png" alt="">
                    <div class="mui-media-body">图片分享</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="#">
                    <!--<span class="mui-icon mui-icon-chatbubble"></span>-->
                    <img src="../../images/menu3.png" alt="">
                    <div class="mui-media-body">商品购买</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="#">
                    <!--<span class="mui-icon mui-icon-location"></span>-->
                    <img src="../../images/menu4.png" alt="">
                    <div class="mui-media-body">留言反馈</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="#">
                    <!--<span class="mui-icon mui-icon-search"></span>-->
                    <img src="../../images/menu5.png" alt="">
                    <div class="mui-media-body">视频专区</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="#">
                    <!--<span class="mui-icon mui-icon-phone"></span>-->
                    <img src="../../images/menu6.png" alt="">
                    <div class="mui-media-body">联系我们</div>
                </router-link>
            </li>
        </ul>


    </div>
</template>

<script>

  // 导入 axios
  import axios from 'axios'

  import {Toast} from 'mint-ui'


  export default {
    name: "Home",
    data() {
      return {
        LunbotuList: [],  //轮播图数据
      }
    },
    created() {
      this.getLunbotu();
    },
    methods: {
      getLunbotu() {
        axios.get('http://wxtest.centaline.com.cn/api/api?type=getslider')
          .then(res => {
            if (res.data.status === 0) {
              this.LunbotuList = res.data.message
            } else {
              Toast('请求数据失败,重新连接!!')
            }
          })
      }
    },


  }


</script>

<style scoped>

    /*轮播图*/
    .mint-swipe {
        height: 200px
    }

    .mint-swipe-item img {
        width: 100%;
        height: 100%;
    }

    /*九宫格*/
    .mui-grid-view.mui-grid-9 {
        background-color: #fff;
    }

    .mui-grid-view.mui-grid-9 .mui-table-view-cell {
        border: none;
    }
    .mui-grid-view.mui-grid-9 .mui-table-view-cell img {
        width: 60px;
        height: 60px;
    }
    .mui-media-body {
        font-size: 13px;
    }




    /*
    .mui-icon-home:before,
    .mui-icon-email:before,
    .mui-icon-chatbubble:before,
    .mui-icon-location:before,
    .mui-icon-search:before,
    .mui-icon-phone:before {
        content: '';
        display: block;
        width: 50px;
        height: 50px;
        background-repeat: round;
    }
    .mui-icon-home:before {
        background-image: url('../../images/menu1.png');
    }
    .mui-icon-email:before {
        background-image: url('../../images/menu2.png');
    }
    .mui-icon-chatbubble:before {
        background-image: url('../../images/menu3.png');
    }
    .mui-icon-location:before {
        background-image: url('../../images/menu4.png');
    }
    .mui-icon-search:before {
        background-image: url('../../images/menu5.png');
    }
    .mui-icon-phone:before {
        background-image: url('../../images/menu6.png');
    }
    */


</style>